<?php // no direct access
defined('_JEXEC') or die('Restricted access');
?>
<?php if ($this->article) : ?>
<form action="index.php?option=com_articlecashrewards" method="post" name="adminForm">
<table class="contentpaneopen">
	<?php if ($this->acr_config[CONFIG_REVIEW_FORM_POSITION] == REVIEW_FORM_POSITION_TOP) : ?>
	<tr>
		<td>
			<fieldset class="adminform">
			<legend><?php echo JText::_( 'Assign Points & Cash' ); ?></legend>
			<table class="admintable">
				<?php if ($this->acr_config[CONFIG_ENABLE_POINTS] == '1') : ?>
                <?php 
                if ((strcmp($this->acr_config[CONFIG_POINTS_SYSTEM], POINTS_SYSTEM_ACR) == 0) ||
                    (strcmp($this->acr_config[CONFIG_POINTS_SYSTEM], POINTS_SYSTEM_AUP) == 0)){
                ?>
				<tr>
					<td width="110" class="key">
						<label for="title">
							<?php echo JText::_( 'Points' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox" type="text" name="points" id="points" size="25" value="<?php echo $this->article->points; ?>" />
					</td>
				</tr>
                <?php
                }else if (strcmp($this->acr_config[CONFIG_POINTS_SYSTEM], POINTS_SYSTEM_JOMSOCIAL) == 0){
                ?>
                <tr>
					<td width="110" class="key">
						<label for="title">
							<?php echo JText::_( 'Points' ); ?>:
						</label>
					</td>
					<td>
                        <table>
                            <tr>
                                <?php
                                $i = 0;
                                for($i=0; $i<$acr_config[CONFIG_JS_POINTS_RATINGS]; $i++){
                                ?>
                                <td><?php echo $i; ?></td>
                                <td>
                                    <input
                                        class="inputbox"
                                        type="radio"
                                        name="points"
                                        id="points<?php echo $i; ?>"
                                        <?php if($this->article->points == $i) echo "checked" ; ?> />
                                </td>
                                <?php
                                }
                                ?>
                            </tr>
                        </table>
						
					</td>
				</tr>
                <?php
                }
                ?>
				<?php endif; ?>
				<tr>
					<td width="110" class="key">
						<label for="alias">
							<?php echo JText::_( 'Cash Rewards' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox" type="text" name="cash" id="cash" size="25" value="<?php echo $this->article->cash; ?>" />
					</td>
				</tr>
				<tr>
					<td width="110" class="key">
						<label for="alias">
							<?php echo JText::_( 'Remarks' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox" type="textarea" name="remarks" id="remarks" size="25" value="<?php echo $this->article->remarks; ?>" />
					</td>
				</tr>
				<tr>
					<td width="110" class="key">
						<label for="alias">
							<?php echo JText::_( 'Approve' ); ?>:
						</label>
					</td>
					<td nowrap="nowrap">
						<input class="inputbox" type="radio" name="cstate" id="cstate" value="1" <?php echo ($this->acr_config[CONFIG_REVIEW_STATUS] == STATUS_APPROVED)?'checked':''; ?>/>Approve &nbsp;&nbsp;
						<input class="inputbox" type="radio" name="cstate" id="cstate" value="2" <?php echo ($this->acr_config[CONFIG_REVIEW_STATUS] == STATUS_REJECTED)?'checked':''; ?>/>Reject
					</td>
				</tr>
			</table>
			</fieldset>
		</td>
	</tr>
	<?php endif; ?>
	<tr>
		<td class="" width="100%">
			<fieldset class="adminform">
			
				<h1><?php echo $this->escape($this->article->title); ?></h1>
				<table class="contentpaneopen">
					<tr>
						<td>
							<span>
								<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getSectionRoute($this->article->sectionid)).'">'; ?>
									<?php echo $this->article->section; ?>
								<?php echo '</a>'; ?>
								<?php echo ' - '; ?>
							</span>
							<span>
								<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->article->catslug, $this->article->sectionid)).'">'; ?>
									<?php echo $this->article->category; ?>
								<?php echo '</a>'; ?>
							</span>
							&nbsp;&nbsp;
						</td>
						<td valign="top">
							<span class="small">
								<?php echo 'Written by: '.$this->article->author; ?>
							</span>
							&nbsp;&nbsp;
						</td>
						<td valign="top" class="createdate">
							<?php echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2')) ?>
							&nbsp;&nbsp;
						</td>
						<td valign="top" class="createdate">
							<?php echo JText::sprintf('Last Updated: ', JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2'))); ?>
						</td>
					</tr>
				</table>
			</fieldset>
		</td>
	</tr>

	<?php if ($this->article->introtext) : ?>
	<tr>
		<td valign="top">
			<fieldset class="adminform">
			<legend><?php echo JText::_( 'Intro Text' ); ?></legend>
				<?php echo $this->article->introtext; ?>
			</fieldset>
		</td>
	</tr>
	<?php endif; ?>	
	
	<?php if ($this->article->fulltext) : ?>
	<tr>
		<td valign="top">
			<fieldset class="adminform">
			<legend><?php echo JText::_( 'Full Text' ); ?></legend>
				<?php echo $this->article->fulltext; ?>
			</fieldset>
		</td>
	</tr>
	<?php endif; ?>	
	<tr>
		<td valign="top">
			<fieldset class="adminform">
			<legend><?php echo JText::_( 'Note' ); ?></legend>
				<?php echo JText::_( 'Please note that the article style and format will vary on front-end as the CSS used by front-end template is differs from back-end.' ); ?>
			</fieldset>
		</td>
	</tr>
	<?php if ($this->acr_config[CONFIG_REVIEW_FORM_POSITION] == REVIEW_FORM_POSITION_BOTTOM) : ?>
	<tr>
		<td>
			<fieldset class="adminform">
			<legend><?php echo JText::_( 'Assign Points & Cash' ); ?></legend>
			<table class="admintable">
				<?php if ($this->acr_config[CONFIG_ENABLE_POINTS] == '1') : ?>
                <?php
                if ((strcmp($this->acr_config[CONFIG_POINTS_SYSTEM], POINTS_SYSTEM_ACR) == 0) ||
                    (strcmp($this->acr_config[CONFIG_POINTS_SYSTEM], POINTS_SYSTEM_AUP) == 0)){
                ?>
				<tr>
					<td width="110" class="key">
						<label for="title">
							<?php echo JText::_( 'Points' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox" type="text" name="points" id="points" size="25" value="<?php echo $this->article->points; ?>" />
					</td>
				</tr>
                <?php
                }else if (strcmp($this->acr_config[CONFIG_POINTS_SYSTEM], POINTS_SYSTEM_JOMSOCIAL) == 0){
                ?>
                <tr>
					<td width="110" class="key">
						<label for="title">
							<?php echo JText::_( 'LABEL_RATING' ); ?>:
						</label>
					</td>
					<td>
                        <table cellpadding="5" cellspacing="0" border="0">
                            <tr>
                                <?php
                                $i = 0;
                                for($i=0; $i < $this->acr_config[CONFIG_JS_POINTS_RATINGS]; $i++){
                                ?>
                                <td align="center"><?php echo $i+1; ?></td>
                                <?php
                                }
                                ?>
                            </tr>
                            <tr>
                            <?php
                            for($i=0; $i < $this->acr_config[CONFIG_JS_POINTS_RATINGS]; $i++){
                            ?>
                            <td align="center">
                                <input
                                    class="inputbox"
                                    type="radio"
                                    name="points"
                                    id="points<?php echo $i; ?>"
                                    value="<?php echo $i+1; ?>"
                                    <?php if($this->article->points == $i+1) echo "checked" ; ?> />
                            </td>
                            <?php
                            }
                            ?>
                            </tr>
                        </table>
					</td>
                    <td>
                        <?php echo JText::_('MSG_JOMSOCIAL_POINTS_UPDATE'); ?>
                    </td>
				</tr>
                <?php
                }
                ?>
				<?php endif; ?>
				<tr>
					<td width="110" class="key">
						<label for="alias">
							<?php echo JText::_( 'Cash Rewards' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox" type="text" name="cash" id="cash" size="25" value="<?php echo $this->article->cash; ?>" />
					</td>
				</tr>
				<tr>
					<td width="110" class="key">
						<label for="alias">
							<?php echo JText::_( 'Remarks' ); ?>:
						</label>
					</td>
					<td>
						<input class="inputbox" type="textarea" name="remarks" id="remarks" size="80" value="<?php echo $this->article->remarks; ?>" />
					</td>
				</tr>
				<tr>
					<td width="110" class="key">
						<label for="alias">
							<?php echo JText::_( 'Approve' ); ?>:
						</label>
					</td>
					<td nowrap="nowrap">
						<input class="inputbox" type="radio" name="cstate" id="cstate" value="1" <?php echo ($this->acr_config[CONFIG_REVIEW_STATUS] == STATUS_APPROVED)?'checked':''; ?>/>Approve &nbsp;&nbsp;
						<input class="inputbox" type="radio" name="cstate" id="cstate" value="2" <?php echo ($this->acr_config[CONFIG_REVIEW_STATUS] == STATUS_REJECTED)?'checked':''; ?>/>Reject
					</td>
				</tr>
			</table>
			</fieldset>
		</td>
	</tr>
	<?php endif; ?>
</table>
<input type="hidden" name="option" value="com_articlecashrewards" />	
<input type="hidden" name="task" value="" />
<input type="hidden" name="article_id" value="<?php echo $this->article->id; ?>" />
<input type="hidden" name="author" value="<?php echo $this->article->created_by; ?>" />
<input type="hidden" name="controller" value="process" />
<input type="hidden" name="redirect" value="<?php echo $this->article->redirect; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php endif; ?>